import Vue from 'vue'
import App from './App.vue'
// 导入element ui 组件库
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// 导入路由模块
import router from './router/index'
import store from './store/index'
// 导入Home下的leftNav菜单
import leftNav from './components/leftNav/leftNav'
import RightNav from './components/RightNav/RightNav'
Vue.component('LeftNav', leftNav)
Vue.component('RightNav', RightNav)
// 使用插件
Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.prototype.$error = function (val) {
  console.log(val)
  this.$message.error(val)
}
Vue.prototype.$success = function (val) {
  console.log(val)
  this.$message({
    message: val,
    type: 'success'
  })
}
new Vue({
  router,
  store,
  beforeCreate () {
    Vue.prototype.$bus = this
  },
  render: h => h(App)
}).$mount('#app')
